package domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="UNIT")
public class Unit {
	
	private String acquisitionDate, unitId;
	private Resource resource;

	@Id
	@Column(name = "UNIT_ID", length=10)
	public String getUnitId() {
		return unitId;
	}
	
	public void setUnitId(String unitId) {
		this.unitId = unitId;
	}

	@Column(name = "ACQUISITION_DATE", length=10)
	public String getAcquisitionDate() {
		return acquisitionDate;
	}

	public void setAcquisitionDate(String acquisitionDate) {
		this.acquisitionDate = acquisitionDate;
	}


	public void setResource(Resource resource) {
		this.resource = resource;
	}

	@ManyToOne
	@JoinColumn(name = "RESOURCE_ID", nullable = false)
	public Resource getResource() {
		return resource;
	}

}
